#include "DateTimeTask.h"

DateTimeTask::DateTimeTask(int year, int month, int date, int hour, int minute, int period, int speeda, int speedb, QObject *parent)
    : QObject(parent), year(year), month(month), date(date) , hour(hour), minute(minute), period(period), speedA(speedb), speedB(speedb) {

}

DateTimeTask::DateTimeTask(QObject* parent)
{

}

void DateTimeTask::setYear(int myear){
    year = myear;
}

void DateTimeTask::setMonth(int mmonth)
{
    month = mmonth;
}

void DateTimeTask::setDate(int mdate)
{
    date = mdate;
}

void DateTimeTask::setHour(int mhour)
{
    hour = mhour;
}

void DateTimeTask::setMinute(int mminute)
{
    minute = mminute;
}

void DateTimeTask::setPeriod(int mperiod)
{
    period = mperiod;
}

void DateTimeTask::setSpeedA(int speeda)
{
    speedA = speeda;
}

void DateTimeTask::setSpeedB(int speedb)
{
    speedB = speedb;
}

QByteArray DateTimeTask::getByteArray()
{

    QByteArray byteArray;
        
        byteArray.append(1, getYear());
        byteArray.append(1, getMonth());
        byteArray.append(1, getDate());
        byteArray.append(1, getHour());
        byteArray.append(1, getMinute());
        byteArray.append(1, (uint8_t)(getPeriod() >> 8) );
        byteArray.append(1, (uint8_t)(getPeriod()));
        byteArray.append(1, getSpeedA());
        byteArray.append(1, getSpeedB());

    return byteArray;
}
